<?php
header("Content-type:text/html;charset=utf-8");
$name=$_POST["name"];
$conn = mysql_connect("localhost","root","root");
	mysql_select_db("jmyp");
	$result = mysql_query("select b.user_name,c.gt_id,c.gt_title,c.gt_money,a.sptc_num,sptc_total,c.gt_url from shoppingcarttable a,userstable b,goodstable c where b.user_id = a.spct_userid and c.gt_id = a.spct_gtid and b.user_name='$name';",$conn);
	// $rows=mysql_fetch_array($result);
	// $json = JSON_encode($rows,JSON_UNESCAPED_UNICODE);
	// echo $json;
	$jarr = array();
		while ($rows=mysql_fetch_array($result)){
		    $count=count($rows);//不能在循环语句中，由于每次删除 row数组长度都减小  
		    for($i=0;$i<$count;$i++){  
	          unset($rows[$i]);//删除冗余数据
		    }
		    array_push($jarr,$rows);
		}
	 $json = JSON_encode($jarr,JSON_UNESCAPED_UNICODE);
	  $arr = json_decode($json);
	  echo $json;
	// $result_row = mysql_num_rows($result);
	// if($result_row >= 1){
	// 	echo "手机号已注册";
	// 	}
	// 	else{
	// 	echo "可以注册";
	// 	}
	// mysql_close($conn);
?>